//
//  TJUIAlertController.h
//  BaoDian
//
//  Created by mac on 2024/7/27.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, TJUIAlertActionStyle) {
    TJUIAlertActionStyleDefault = 0,
    TJUIAlertActionStyleCancel,
    TJUIAlertActionStyleDestructive
};

typedef NS_ENUM(NSInteger, TJUIAlertControllerStyle) {
    TJUIAlertControllerStyleActionSheet = 0,
    TJUIAlertControllerStyleAlert
};

@interface TJUIAlertAction: NSObject

+ (instancetype)actionWithTitle:(nullable NSString *)title style:(TJUIAlertActionStyle)style handler:(void (^ __nullable)(TJUIAlertAction *action))handler;
@property (nonatomic, copy, readonly) NSString *title;

@end

@interface TJUIAlertController : UIViewController

@property (nonatomic, readonly) NSArray<TJUIAlertAction *> *actions;

+ (instancetype)alertControllerWithTitle:(nullable NSString *)title message:(nullable NSString *)message preferredStyle:(TJUIAlertControllerStyle)preferredStyle;

- (void)showInViewController:(UIViewController *)viewController;

- (void)addAction:(TJUIAlertAction *)action;

@end

NS_ASSUME_NONNULL_END
